<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Russian Dolls for the Maximum Stable Set Problem: datast/heap.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Russian Dolls for the Maximum Stable Set Problem
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Macros</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_f14de42a71a14f2d520d5e47ce140531.html">datast</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">heap.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="heap_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef HEAP_H_</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HEAP_H_</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">// Partially sort the specified array of &lt;tt&gt;nmemb&lt;/tt&gt; elements of size &lt;tt&gt;size&lt;/tt&gt; in a heap manner.  </span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">// The &lt;tt&gt;base&lt;/tt&gt; argument points to the start of the array.</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">// The  contents  of the array are partially sorted in ascending order according to a comparison function pointed to by &lt;tt&gt;compar&lt;/tt&gt;, </span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">// which is called with two arguments that point to the objects being compared.</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">// The comparison function must return an integer less than, equal to, or greater than zero if the first argument is considered  to  be  respectively</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">// less than, equal to, or greater than the second.  If two members compare as equal, their order in the sorted array is undefined.</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="keywordtype">void</span> <a class="code" href="heap_8c.html#abf6db9c52c0af825f656899af4ffe24b">heapify</a>(<span class="keywordtype">void</span> *base, <span class="keywordtype">size_t</span> nmemb, <span class="keywordtype">size_t</span> size, <span class="keywordtype">int</span>(*compar)(<span class="keyword">const</span> <span class="keywordtype">void</span> *, <span class="keyword">const</span> <span class="keywordtype">void</span> *));</div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="keywordtype">void</span> <a class="code" href="heap_8c.html#ae7e65ae824d2df4a391ca7e1c7949cce">heapify_a</a>(<span class="keywordtype">void</span> *b, <span class="keywordtype">size_t</span> nmemb, <span class="keywordtype">size_t</span> size, <span class="keywordtype">int</span>(*compar)(<span class="keyword">const</span> <span class="keywordtype">void</span> *, <span class="keyword">const</span> <span class="keywordtype">void</span> *), <span class="keywordtype">int</span> * <a class="code" href="wclique3_8c.html#a740a37c1cf7c17f4d6ed59d153dcb814">pos</a>, <span class="keywordtype">int</span>(*hash)(<span class="keyword">const</span> <span class="keywordtype">void</span> *));</div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment">// The same as above with an additional argument passed to each call to the compar function</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="keywordtype">void</span> <a class="code" href="heap_8c.html#a01aea86f0468ce1566a6b42fbebf6380">heapify_r</a>(<span class="keywordtype">void</span> *base, <span class="keywordtype">size_t</span> nmemb, <span class="keywordtype">size_t</span> size, <span class="keywordtype">int</span>(*compar)(<span class="keyword">const</span> <span class="keywordtype">void</span> *, <span class="keyword">const</span> <span class="keywordtype">void</span> *, <span class="keywordtype">void</span> *), <span class="keywordtype">void</span> * arg);</div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="keywordtype">int</span> <a class="code" href="heap_8c.html#a910ffd49f9e96effb47af207aa623197">heapup</a>(<span class="keywordtype">void</span> *b, <span class="keywordtype">int</span> i, <span class="keywordtype">size_t</span> size, <span class="keywordtype">int</span>(*compar)(<span class="keyword">const</span> <span class="keywordtype">void</span> *, <span class="keyword">const</span> <span class="keywordtype">void</span> *));</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="keywordtype">int</span> <a class="code" href="heap_8c.html#a247bd92940f0e672c3c9272d543d47a6" title="Version that keeps an especified array of positions updated.">heapup_a</a>(<span class="keywordtype">void</span> *b, <span class="keywordtype">int</span> i, <span class="keywordtype">size_t</span> size, <span class="keywordtype">int</span>(*compar)(<span class="keyword">const</span> <span class="keywordtype">void</span> *, <span class="keyword">const</span> <span class="keywordtype">void</span> *), <span class="keywordtype">int</span> * pos, <span class="keywordtype">int</span>(*hash)(<span class="keyword">const</span> <span class="keywordtype">void</span> *));</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="keywordtype">int</span> <a class="code" href="heap_8c.html#aa2c8a0821cb6835652afccc708bae23f">heapup_r</a>(<span class="keywordtype">void</span> *b, <span class="keywordtype">int</span> i, <span class="keywordtype">size_t</span> size, <span class="keywordtype">int</span>(*compar)(<span class="keyword">const</span> <span class="keywordtype">void</span> *, <span class="keyword">const</span> <span class="keywordtype">void</span> *, <span class="keywordtype">void</span> *), <span class="keywordtype">void</span> * arg);</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="keywordtype">int</span> <a class="code" href="heap_8c.html#a8609fd2f19c1df247b957c1a60e5a36b">heapdown</a>(<span class="keywordtype">void</span> *base, <span class="keywordtype">int</span> i, <span class="keywordtype">size_t</span> nmemb, <span class="keywordtype">size_t</span> size, <span class="keywordtype">int</span>(*compar)(<span class="keyword">const</span> <span class="keywordtype">void</span> *, <span class="keyword">const</span> <span class="keywordtype">void</span> *));</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="keywordtype">int</span> <a class="code" href="heap_8c.html#a5e2fab906f1ebb01f355deba2779a08c">heapdown_a</a>(<span class="keywordtype">void</span> *b, <span class="keywordtype">int</span> i, <span class="keywordtype">size_t</span> nmemb, <span class="keywordtype">size_t</span> size, <span class="keywordtype">int</span>(*compar)(<span class="keyword">const</span> <span class="keywordtype">void</span> *, <span class="keyword">const</span> <span class="keywordtype">void</span> *), <span class="keywordtype">int</span> * pos, <span class="keywordtype">int</span>(*hash)(<span class="keyword">const</span> <span class="keywordtype">void</span> *));</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="keywordtype">int</span> <a class="code" href="heap_8c.html#a8a58d09849a182c8899ddc00877647b5">heapdown_r</a>(<span class="keywordtype">void</span> *base, <span class="keywordtype">int</span> i, <span class="keywordtype">size_t</span> nmemb, <span class="keywordtype">size_t</span> size, <span class="keywordtype">int</span>(*compar)(<span class="keyword">const</span> <span class="keywordtype">void</span> *, <span class="keyword">const</span> <span class="keywordtype">void</span> *, <span class="keywordtype">void</span> *), <span class="keywordtype">void</span> * arg);</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="comment">// Add a new element &lt;tt&gt;x&lt;/tt&gt; to a specified array, which is assumed to be partially sorted in a heap manner.</span></div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="comment">// It is also assumed that the specified array has enough place for the new element.</span></div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="comment">// The remaining arguments are similar to the ones of &lt;tt&gt;heapify&lt;/tt&gt;.</span></div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="keywordtype">void</span> <a class="code" href="heap_8c.html#a9fe8a8f1a81823b87aa71f8598db615c">heapoffer</a>(<span class="keywordtype">void</span> *x, <span class="keywordtype">void</span> *base, <span class="keywordtype">size_t</span> nmemb, <span class="keywordtype">size_t</span> size, <span class="keywordtype">int</span>(*compar)(<span class="keyword">const</span> <span class="keywordtype">void</span> *, <span class="keyword">const</span> <span class="keywordtype">void</span> *));</div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="keywordtype">void</span> <a class="code" href="heap_8c.html#ab58d0d543f50208bddc0af8fe47209c9">heapoffer_a</a>(<span class="keywordtype">void</span> *x, <span class="keywordtype">void</span> *b, <span class="keywordtype">size_t</span> nmemb, <span class="keywordtype">size_t</span> size, <span class="keywordtype">int</span>(*compar)(<span class="keyword">const</span> <span class="keywordtype">void</span> *, <span class="keyword">const</span> <span class="keywordtype">void</span> *), <span class="keywordtype">int</span> * pos, <span class="keywordtype">int</span>(*hash)(<span class="keyword">const</span> <span class="keywordtype">void</span> *));</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="keywordtype">void</span> <a class="code" href="heap_8c.html#a4e1e0d867a92812dc16fab19aaddca19">heapoffer_r</a>(<span class="keywordtype">void</span> *x, <span class="keywordtype">void</span> *base, <span class="keywordtype">size_t</span> nmemb, <span class="keywordtype">size_t</span> size, <span class="keywordtype">int</span>(*compar)(<span class="keyword">const</span> <span class="keywordtype">void</span> *, <span class="keyword">const</span> <span class="keywordtype">void</span> *, <span class="keywordtype">void</span> *), <span class="keywordtype">void</span> * arg);</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<span class="keywordtype">void</span> <a class="code" href="heap_8c.html#a3c44c87035bb56d56d977b17bb2df558">heappoll</a>(<span class="keywordtype">void</span> *base, <span class="keywordtype">size_t</span> nmemb, <span class="keywordtype">size_t</span> size, <span class="keywordtype">int</span>(*compar)(<span class="keyword">const</span> <span class="keywordtype">void</span> *, <span class="keyword">const</span> <span class="keywordtype">void</span> *));</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="keywordtype">void</span> <a class="code" href="heap_8c.html#a492bed6e44c81596c04f880b3de5242d">heappoll_a</a>(<span class="keywordtype">void</span> *b, <span class="keywordtype">size_t</span> nmemb, <span class="keywordtype">size_t</span> size, <span class="keywordtype">int</span>(*compar)(<span class="keyword">const</span> <span class="keywordtype">void</span> *, <span class="keyword">const</span> <span class="keywordtype">void</span> *), <span class="keywordtype">int</span> * pos, <span class="keywordtype">int</span>(*hash)(<span class="keyword">const</span> <span class="keywordtype">void</span> *));</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="keywordtype">void</span> <a class="code" href="heap_8c.html#af255909b8df4e8abade4329c966aed98">heappoll_r</a>(<span class="keywordtype">void</span> *base, <span class="keywordtype">size_t</span> nmemb, <span class="keywordtype">size_t</span> size, <span class="keywordtype">int</span>(*compar)(<span class="keyword">const</span> <span class="keywordtype">void</span> *, <span class="keyword">const</span> <span class="keywordtype">void</span> *, <span class="keywordtype">void</span> *), <span class="keywordtype">void</span> * arg);</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/*HEAP_H_*/</span><span class="preprocessor"></span></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Mar 14 2014 13:23:35 for Russian Dolls for the Maximum Stable Set Problem by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.1.1
</small></address>
</body>
</html>
